package com.pan.admin.generator.service;

import com.pan.admin.generator.dao.ApiGenConfigDao;
import com.pan.admin.generator.entity.ApiGenConfigPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class ApiGenConfigServiceImpl implements ApiGenConfigService {

    @Autowired
    private ApiGenConfigDao apiGenConfigDao;

    @Override
    @Transactional(readOnly = true)
    public List<ApiGenConfigPO> list(String configName) {
        return apiGenConfigDao.list(configName);
    }

    @Override
    @Transactional(readOnly = true)
    public ApiGenConfigPO get(Long id) {
        return apiGenConfigDao.get(id);
    }

    @Override
    @Transactional(readOnly = true)
    public ApiGenConfigPO getByHashCode(String hashCode) {
        return apiGenConfigDao.getByHashCode(hashCode);
    }

    @Override
    public void insert(ApiGenConfigPO apiGenConfigPO) {
        apiGenConfigDao.insert(apiGenConfigPO);
    }
}
